//
//  CarDetailInfoTableViewCell.m
//  OneCreditTreasure
//
//  Created by iOS Tedu on 16/8/30.
//
//

#import "CarDetailInfoTableViewCell.h"

@implementation CarDetailInfoTableViewCell
#pragma mark - 生命周期 life cycle
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

#pragma mark - 懒加载 lazy loading
- (UILabel *)leftLB {
    if(_leftLB == nil) {
        _leftLB = [[UILabel alloc] init];
        [self.contentView addSubview:_leftLB];
        [_leftLB mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(12);
            make.top.equalTo(8);
            make.bottom.equalTo(-8);
            make.right.equalTo(self.infoTF.mas_left).equalTo(0);
        }];
        _leftLB.font = defaultFont;
    }
    return _leftLB;
}

- (UITextField *)infoTF {
    if(_infoTF == nil) {
        _infoTF = [[UITextField alloc] init];
        [self.contentView addSubview:_infoTF];
        [_infoTF mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(kScreenW / 3);
            make.top.equalTo(4);
            make.bottom.equalTo(-4);
            make.right.equalTo(self.unitLB.mas_left).equalTo(-8);
        }];
        _infoTF.font = defaultFont;
        _infoTF.clearButtonMode = UITextFieldViewModeWhileEditing;
        _infoTF.textColor = [UIColor lightGrayColor];
    }
    return _infoTF;
}

- (UILabel *)unitLB {
    if(_unitLB == nil) {
        _unitLB = [[UILabel alloc] init];
        [self.contentView addSubview:_unitLB];
        [_unitLB mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(kScreenW / 3 * 2);
            make.top.equalTo(8);
            make.right.equalTo(-8);
            make.bottom.equalTo(-8);
        }];
        _unitLB.font = defaultFont;
    }
    return _unitLB;
}

@end
